//
// Created by francklinson on 2021/10/23 AT 15:20.
//
#include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <algorithm>
#include <functional>
#include <climits>
#include <string>
#include "../myTool.h"

//using namespace std;
class Entity{
public:
    Entity(){
        std::cout<<"Entity created!"<<std::endl;
    }
    ~Entity(){
        std::cout <<"Entity destroyed"<<std::endl;
    }
};
int main() {
    {
        std::shared_ptr<Entity>e0;
        {
            std::shared_ptr<Entity>sharedEntity = std::make_shared<Entity>();
            std::weak_ptr<Entity>weakEntity = sharedEntity; // weak_ptr不增加引用计数
            e0 = sharedEntity; // shared_ptr之间的复制和赋值会增加引用计数
        }
    }
    return 0;
}

